/*	talmud - The TALMUD roguelike
 * Copyright (C) 2012, talmud contributors
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of Version 2 of the GNU General Public License as published
 *  by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful, but WITHOUT
 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public
 *  License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef rand_h
#define rand_h

#include <stdint.h>

// Statistically even distribution from 0 to max-1
uint32_t rn1(int32_t max);
// Heavily bottom-weighted distribution from 0 to max-1
uint32_t rn2(int32_t max);
#define rn2i(x)	((x - 1) - rn2(x))
// Slightly bottom-weighted distribution from 0 to max-1
uint32_t rn3(int32_t max);
#define rn3i(x)	((x - 1) - rn3(x))

#endif
